import 'package:flutter_test/flutter_test.dart';
import 'package:avd_sdk_plugin/avd_sdk_plugin.dart';
import 'package:avd_sdk_plugin/avd_sdk_plugin_platform_interface.dart';
import 'package:avd_sdk_plugin/avd_sdk_plugin_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockAvdSdkPluginPlatform
    with MockPlatformInterfaceMixin
    implements AvdSdkPluginPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final AvdSdkPluginPlatform initialPlatform = AvdSdkPluginPlatform.instance;

  test('$MethodChannelAvdSdkPlugin is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelAvdSdkPlugin>());
  });

  test('getPlatformVersion', () async {
    AvdSdkPlugin avdSdkPlugin = AvdSdkPlugin();
    MockAvdSdkPluginPlatform fakePlatform = MockAvdSdkPluginPlatform();
    AvdSdkPluginPlatform.instance = fakePlatform;

    expect(await avdSdkPlugin.getPlatformVersion(), '42');
  });
}
